<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<title>Python-Anaconda环境配置 | pansis.io</title>
<link rel="shortcut icon" href="https://github.pansis.site/favicon.ico">
<link href="https://github.pansis.site/styles/main.css" rel="stylesheet">
<link href="//at.alicdn.com/t/c/font_1678829_b85ccgkdqkr.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" rel="stylesheet">
<link rel="alternate" type="application/rss+xml" title="pansis.io » Feed" href="https://github.pansis.site/atom.xml">
        <meta name="description" content="以下Python环境的配置，与Pycharm和Anaconda紧密配合。
Pycharm安装
进入官网https://www.jetbrains.com/pycharm/
在下载界面中下载社区版

下载完成后，根据安装提示一路安装即可。安装..." />
        <meta name="keywords" content="Python与OpenCV" />
        <!-- OG -->
        <meta property="og:locale" content="zh_CN">
        <meta property="og:title" content="Python-Anaconda环境配置" />
        <meta property="og:type" content="article" />
        <meta property="og:description" content="以下Python环境的配置，与Pycharm和Anaconda紧密配合。
Pycharm安装
进入官网https://www.jetbrains.com/pycharm/
在下载界面中下载社区版

下载完成后，根据安装提示一路安装即可。安装...">
        <meta property="og:url" content="https://github.pansis.site/post/python-anaconda-huan-jing-pei-zhi/" />
        <meta property="og:site_name" content="pansis.io">
        <meta property="og:updated_time" content="2023-06-27">
        <meta property="og:image" content="" />
        <meta property="og:image:secure_url" content="">
        <meta property="og:image:alt" content="Python-Anaconda环境配置">
        <!-- Twitter (post.ejs) -->
        <meta name="twitter:card" content="summary_large_image">
        <meta name="twitter:title" content="Python-Anaconda环境配置">
        <meta name="twitter:description" content="以下Python环境的配置，与Pycharm和Anaconda紧密配合。
Pycharm安装
进入官网https://www.jetbrains.com/pycharm/
在下载界面中下载社区版

下载完成后，根据安装提示一路安装即可。安装...">
        <!-- <meta name="twitter:site" content="@WBoy0609">
        <meta name="twitter:creator" content="@WBoy0609"> -->
        <meta name="twitter:image" content="">
</head>

<body>
    <div class="main animated">
        <div class="header animated fadeInDown">
    <div class="site_title_container">
        <div class="site_title">
            <a href="https://github.pansis.site">pansis.io</a>
        </div>
    </div>
    <div class="my_socials">
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
        <a href="https://github.pansis.site/atom.xml" title="rss" target="_blank"><i class="iconfont icon-rss"></i></a>
    </div>
</div>

    <div class="header_menu">
        
            
                <a href="/" class="menu">首页</a>
            
        
            
                <a href="/tag/GWAaV2nvk/" class="menu">程序设计课程</a>
            
        
            
                <a href="/tag/24hangc" class="menu">比赛</a>
            
        
            
                <a href="/tag/L7r9STb75/" class="menu">Python教程</a>
            
        
            
                <a href="/tags" class="menu">分类</a>
            
        
        <div class="gridea-search-div">
            <form id="gridea-search-form" action="https://github.pansis.site/search/">
                <input class="gridea-search-input" autocomplete="off" spellcheck="false" name="q"/>
            </form>
        </div>
    </div>

            <div class="autopagerize_page_element">
                <div class="content">
                    <div class="post_page">
                        <div class="post animated fadeInDown">
                            <div class="post_title post_detail_title">
                                <h2>
                                    Python-Anaconda环境配置
                                </h2>
                                <span class="article-info">
                                    2023-06-27, 673 words, 3 min read
                                </span>
                            </div>
                            <div class="post_content markdown">
                                <p class="md_block">
                                    <span class="md_line md_line_start md_line_end">
                                        <p>以下Python环境的配置，与Pycharm和Anaconda紧密配合。</p>
<h2 id="pycharm安装">Pycharm安装</h2>
<p>进入官网https://www.jetbrains.com/pycharm/</p>
<p>在下载界面中下载社区版</p>
<figure data-type="image" tabindex="1"><img src="http://cos.pansis.site/202309051023128.png" alt="image-20230905102346869" loading="lazy"></figure>
<p>下载完成后，根据安装提示一路安装即可。安装好的pycharm先不要启动。</p>
<p>如果对Pycharm的英文界面不熟悉，可以查看教程最后的安装中文插件部分。</p>
<h2 id="anaconda安装">Anaconda安装</h2>
<p>进入官网https://www.anaconda.com/download/#windows</p>
<figure data-type="image" tabindex="2"><img src="http://cos.pansis.site/202309051026716.png" alt="image-20230905102606556" loading="lazy"></figure>
<p>下载结束后，打开安装包安装</p>
<p>单击【Next】，</p>
<figure data-type="image" tabindex="3"><img src="http://cos.pansis.site/202309051028041.png" alt="image-20230905102815972" loading="lazy"></figure>
<p>单击【I Agree】，</p>
<figure data-type="image" tabindex="4"><img src="http://cos.pansis.site/202309051028035.png" alt="image-20230905102825896" loading="lazy"></figure>
<p>“Just Me”是只供当前用户使用，“All Users”是供使用这台电脑的所有用户使用，是权限问题，无论</p>
<p>如何选择，对安装空间影响不大，</p>
<p>一般选择“All Users”，单击【Next】，</p>
<figure data-type="image" tabindex="5"><img src="http://cos.pansis.site/202309051028946.png" alt="image-20230905102839860" loading="lazy"></figure>
<p>选择安装路径，此处注意，</p>
<p><strong>安装路径不可以出现：中文、空格、括号等特殊字符，同时不建议放置在C盘，后续环境配置可能没有权限创建环境</strong>，请务必记住这个安装路径，后续配置将会用到。</p>
<p>单击【Next】，</p>
<figure data-type="image" tabindex="6"><img src="http://cos.pansis.site/202309051028484.png" alt="image-20230905102849413" loading="lazy"></figure>
<p>单击【Next】，</p>
<figure data-type="image" tabindex="7"><img src="http://cos.pansis.site/202309051031396.png" alt="image-20230905103155352" loading="lazy"></figure>
<h2 id="python环境配置">Python环境配置</h2>
<p>首先打开Pycharm，在开始页面创建一个项目。</p>
<figure data-type="image" tabindex="8"><img src="http://cos.pansis.site/202309051040129.png" alt="image-20230905104028044" loading="lazy"></figure>
<p>请根据蓝框配置选择conda和python3.8（推荐）版本，红框位置为项目和环境存放路径，可自定义。</p>
<figure data-type="image" tabindex="9"><img src="http://cos.pansis.site/202309051041237.png" alt="image-20230905104103165" loading="lazy"></figure>
<p>conda位置选择anaconda安装路径下的_conda.exe</p>
<p>(如果你直接安装在下图中的默认路径中，无法找到programdata文件夹，可以直接复制下面的路径)</p>
<figure data-type="image" tabindex="10"><img src="http://cos.pansis.site/202309051048526.png" alt="image-20230905104842450" loading="lazy"></figure>
<p>点击create后，IDE将自动创建环境。</p>
<p>在新打开的界面中，运行自动创建的脚本，若下方区域正常输出，则环境创建完成。</p>
<figure data-type="image" tabindex="11"><img src="http://cos.pansis.site/202309051107534.png" alt="image-20230905110743304" loading="lazy"></figure>
<p>创建环境中，如果出现因为权限不足导致创建失败的问题。这是因为将conda安装在了C盘，C盘的读写需要更高的权限。请关闭pycharm，以管理员身份运行。</p>
<figure data-type="image" tabindex="12"><img src="http://cos.pansis.site/202309051110449.png" alt="image-20230905111031385" loading="lazy"></figure>
<h2 id="其他操作">其他操作</h2>
<h3 id="python环境操作">Python环境操作</h3>
<p>打开设置，在下图位置的解释器设置中，可以进行环境创建、切换与删除。</p>
<figure data-type="image" tabindex="13"><img src="http://cos.pansis.site/202309051054420.png" alt="image-20230905105414257" loading="lazy"></figure>
<h2 id="ide中文插件">IDE中文插件</h2>
<ul>
<li>打开Pycharm的设置</li>
<li>选择Plugins，搜索Chinese</li>
<li>在搜索出的插件中，选择&quot;Chinese（Simplified）Language Pack/中文语言包&quot;，点击“Install”</li>
<li>重新启动一下Pycharm即可<br>
<img src="https://img-blog.csdnimg.cn/62d513c31bb3444fbdc8781df4fd978c.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA6LeR6ams55qE5rGJ5a2Q552h55yg5LiN6Laz,size_20,color_FFFFFF,t_70,g_se,x_16" alt="在这里插入图片描述" loading="lazy"><br>
<img src="https://img-blog.csdnimg.cn/b3e6854a55da4e1299d8b4bd10f25daf.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA6LeR6ams55qE5rGJ5a2Q552h55yg5LiN6Laz,size_20,color_FFFFFF,t_70,g_se,x_16" alt="在这里插入图片描述" loading="lazy"></li>
</ul>
<p>转载于<a href="http://www.taodudu.cc/news/show-4781473.html?action=onClick">PyCharm 汉化插件 (taodudu.cc)</a></p>
<h2 id="安装python库">安装Python库</h2>
<p>当你想要安装库时，点击界面中的该图标</p>
<figure data-type="image" tabindex="14"><img src="http://cos.pansis.site/202309051051257.png" alt="image-20230905105111086" loading="lazy"></figure>
<p>在该命令行下使用pip命令安装库。</p>
<p>比如安装OpenCV，输入pip install opencv-python，回车即可自动安装。</p>
<p>注意：这种方法并不是标准方法，建议大家自行学习conda的一些命令，在cmd控制台尝试安装库，这样会对Python环境有更深的理解。</p>
<br />
                                            
                                </p>
                            </div>
                            <div class="post_footer">
                                
                                    <div class="meta">
                                        <div class="info"><span class="field tags"><i class="iconfont icon-tag-sm"></i>
                                                
                                                    <a href="https://github.pansis.site/tag/L7r9STb75/" class="article-info">
                                                        Python与OpenCV
                                                    </a>
                                                    
                                            </span>
                                        </div>
                                    </div>
                                    
                                        
                            </div>
                        </div>
                        
                            
                                <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<div id="gitalk-container" style="padding-bottom: 20px;"></div>
<script>
    var pageId = (location.pathname).substring(1, 49) // Ensure uniqueness and length less than 50
    pageId = pageId.endsWith('/') ? pageId.slice(0, -1) : pageId // 以斜杠结尾则去除
    var gitalk = new Gitalk({
        clientID: '9d5eba33618472c44a07',
        clientSecret: '065a85ed04333ceebfc4f01d7ca1674175730339',
        repo: 'fzxl2003.github.io',
        owner: 'fzxl2003',
        admin: ['fzxl2003'],
        id: pageId,
        distractionFreeMode: false  // Facebook-like distraction free mode
    })
    gitalk.render('gitalk-container')
</script>
                                    
                                        
                                                    
                    </div>
                </div>
            </div>
    </div>
    <div class="footer">
    
    <div class="powered_by">
        <a href="https://codeberg.org/kytrun/gridea-theme-one" target="_blank">Theme One,</a>
        <a href="https://open.gridea.dev/" target="_blank">Powered by Gridea&#65281;</a>
    </div>
    
    
        <div class="footer_slogan">
            Powered by <a href="https://github.com/getgridea/gridea" target="_blank">Gridea</a>
        </div>
    
    <div id="back_to_top" class="back_to_top">
        <span>△</span>
    </div>
    
</div>

<script src="https://github.pansis.site/media/scripts/util.js"></script>
        <link rel="stylesheet" href="//unpkg.com/@highlightjs/cdn-assets@11.5.1/styles/default.min.css">
        <script src="//unpkg.com/@highlightjs/cdn-assets@11.5.1/highlight.min.js"></script>
        <script>hljs.highlightAll();</script>
</body>

</html>